#ifndef DOUBLE_LIST_H_
#define DOUBLE_LIST_H_

typedef enum  _dlist_ret_ {
	DLIST_RET_OK,
	DLIST_RET_MEM,
	DLIST_RET_PRA,
	DLIST_RET_END,
} dlist_ret_e;

typedef dlist_ret_e (*loop_func)(void *data,void **value);
typedef void (*printf_f)(void *data);
struct _dlist_;
typedef struct _dlist_  dlist_s;

dlist_s * dlist_create(void);
size_t dlist_get_length(dlist_s * thiz);
dlist_ret_e dlist_insert(dlist_s *thiz,size_t index,void *data);
dlist_ret_e  dlist_append(dlist_s *thiz,void *data);
dlist_ret_e dlist_preappend(dlist_s * thiz, void *data);
dlist_ret_e dlist_delete(dlist_s *thiz,size_t index);
dlist_ret_e dlist_get_by_index(dlist_s *thiz,size_t index,void **data);
dlist_ret_e dlist_set_by_index(dlist_s *thiz,size_t index,void *data);
dlist_ret_e dlist_destory(dlist_s *thiz);
dlist_ret_e dlist_printf(dlist_s *thiz,printf_f print);

dlist_ret_e dlist_loop(dlist_s *thiz,loop_func loop_fun,void **value);
#endif

